<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			function test(){
				var marty = {
					name: 'marty',
					printName: function(){
						console.log(this.name);
					}
				}
				
				var test1 = {
					name: 'test1'
				}
				
				var test2 = {
					name: 'test2'
				}
				
				var test3 = {
					name: 'test3'
				}
				test3.printName = marty.printName;
				marty.printName.call(test1); // test1
				marty.printName.apply(test2);// test2
				marty.printName(); // marty
				test3.printName(); // test3
			
		</script>
	</body>
</html>
